﻿using System;
using System.Xml.Linq;

namespace CodeCounsel.SharePoint.RibbonDesigner.Model
{
    public class DomainModelBuilder
    {
        Type _controlType;

        protected DomainModelBuilder()
        {
        }

        public DomainModelBuilder(Type controlType)
        {
            _controlType = controlType;
        }

        public virtual DomainElement Build(XElement element, DomainModelSource source)
        {
            return (DomainElement)Activator.CreateInstance(_controlType, element, source);
        }
    }
}
